//很鸡肋的引用 到现在小程序竟然不支持ES7
import regeneratorRuntime from '../../utils/regenerator-runtime/runtime-module';

const app = getApp()
Page({
    data: {
        commonImgUrl: '',//全局图片网络路径
        listAd: [],//首页轮播
        listAuction: [],//在线拍卖推荐
        listAuctionAd: [],//拍卖专场广告图推荐
        listartist: [],//艺术家推荐
        listArtistHead: [],//艺术家头像随机推荐
        listbaozhen: [],//艺术品推荐(保真臻品）
        listshengzhi: [],//艺术品推荐(升值潜力)
        listgexing: [],//艺术品推荐(个性鲜明)
        listcontent: [],//美术馆推荐
        listguesslike: [],//猜你喜欢
        AuctionInfo: {},
    },
    /**
     * @author 焦政
     * @date 2019/6/27
     * @Description: 首页组件数据
     */
    async getIndexComponentData() {
        var optionss = {
            data: {}
        };
        let resComponent = await app.$net.post('getIndexComponentData', 1, optionss);
        console.log('首页', resComponent)
        //成功获取结果
        if (resComponent.data.return_code == 0) {
            this.setData({
                listAd: resComponent.data.listAd,
                listAuction: resComponent.data.listAuction,
                AuctionInfo: resComponent.data.listAuction[0].auctionSpecialPlaceDTO,//首次加载赋值在线拍卖推荐详情
                listAuctionAd: resComponent.data.listAuctionAd,
                listartist: resComponent.data.listartist,
                listArtistHead: resComponent.data.listArtistHead,
                listbaozhen: resComponent.data.listbaozhen,
                listshengzhi: resComponent.data.listshengzhi,
                listgexing: resComponent.data.listgexing,
                listcontent: resComponent.data.listcontent,
                listguesslike: resComponent.data.listguesslike,
            })
        }
    },
    /**
     * @author 焦政
     * @date 2019/6/28
     * @Description: 艺术家列表
     */
    async getPlateArtistList() {
        var opionss = {
            data: {}
        }
        let resPlateArtistList = await app.$net.post('getPlateArtistList', 1, opionss)
        console.log(resPlateArtistList)
    },
    onLoad: function () {

    },

    onShow: function () {
        //配置全局图片网络路径
        this.setData({
            commonImgUrl: app.$imgURL
        })
        //获取首页组件数据
        this.getIndexComponentData()
        //获取艺术家列表
        this.getPlateArtistList()

    }
})
